

import api from '@/util/request'
import { PREFIX } from '@/constant/const'
const urlcode = PREFIX.urlCode // 来源数据中台
const reimburseUrl = PREFIX.reimburse // 来源报账平台


// 表单记录分页查询
export function formPageRecord(data) {
  return api.post(reimburseUrl + '/form/pageRecord', data)
}

// 报账端表单记录分页查询
export function formPageRecordReimburse(data) {
  return api.post(reimburseUrl + '/form/page-record-reimburse', data)
}

// 导出
export function exportFormRecord(data) {
  return api({
    url: reimburseUrl + '/form/exportFormRecord',
    method: 'post',
    data: data,
    responseType: 'blob',
    isResponse: false
  })
}

// 报账端表单记录导出
export function exportFormRecordReimburse(data) {
  return api({
    url: reimburseUrl + '/form/export-form-record-reimburse',
    method: 'post',
    data: data,
    responseType: 'blob',
    isResponse: false
  })
}

// 表单记录-根据业务类型code获取筛选条件
export function getConditions(params) {
    return api.get(reimburseUrl + `/form/getConditions/${params.bizTypeCode}`)
}

// 表单记录-调整审批人
export function adjustmentApprover(data) {
  return api.post(reimburseUrl + '/flow/task/adjustmentApprover', data)
}

// 表单记录-获取所有提交过的用户
export function getAllCommitUser() {
  return api.get(reimburseUrl + `/form/getAllCommitUser`)
}
// 根据业务子类code列表获取表单列表
export function getFormListBySubBiz(data) {
  return api.post(urlcode + '/writeForm/list-by-sub-biz-type', data)
}
